<?	
class TagsCommon
{	
	private $project;
	private $db_name;
	
	private function setProjectId($id=1)
	{		 
		$this->project = $id*1;		
	}
	
	private function getProjectId()
	{
		return $this->project;
	}
	
	private function setDbName($db='news_common')
	{
		$this->db_name = $db;		
	}
	
	private function getDbName()
	{
		return $this->db_name;
	}
		
	function __construct($project_id=5, $db='news_common')
	{
		$this->setProjectId($project_id);
		$this->setDbName($db);
	}
	
	function getPopularTags($args)
	{
		$tag_manager = new TagsCommonManager();
		return $tag_manager->getPopularTags($this->getProjectId(), $this->getDbName(), &$args);
	}
	
	function getRandomTags($limit=20)
	{
		$tag_manager = new TagsCommonManager();
		return $tag_manager->getRandomTags($this->getProjectId(), $this->getDbName(), $limit=20);
	}
	
	function getTagNameByTagId($tag_id)
	{
		$tag_manager = new TagsCommonManager();
		return $tag_manager->getTagNameByTagId($tag_id, $this->getProjectId(), $this->getDbName());
	}
	
	function getTagsByNewsId($news_id)
	{
		$tags_manager = new TagsCommonManager();
		return $tags_manager->getTagsByNewsId($news_id, $this->getProjectId(),$this->getDbName());
	}
	
	function updateTagReitingByNewsID($news_id)
	{
		$tags_manager = new TagsCommonManager();
		$tags_manager->updateTagReitingByNewsID($news_id,$this->getProjectId(),$this->getDbName());
	}
}
?>